Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear webhook cache when webhooks are deleted #695

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lancepioch
Copy link
Member

Fixes #689

@lancepioch lancepioch self-assigned this Oct 31, 2024
@lancepioch lancepioch added the 🐛 bug Something isn't working label Oct 31, 2024
@lancepioch lancepioch marked this pull request as draft November 1, 2024 23:37
});

self::deleted(static function (self $webhookConfiguration): void {
self::updateCache(collect($webhookConfiguration->events));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self::updateCache(collect($webhookConfiguration->events));
self::updateCache(collect((array) $webhookConfiguration->events));


cache()->forever('watchedWebhooks', WebhookConfiguration::pluck('events')->flatten()->unique()->values()->all());
private static function updateCache($eventList): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static function updateCache($eventList): void
private static function updateCache(Collection $eventList): void

Copy link
Contributor

@RMartinOscar RMartinOscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this on top

use Illuminate\Support\Collection;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleted Webhook still triggers
3 participants